package bavaria.hightech.testit.logging_proxy;

import java.util.logging.Level;
import java.util.logging.Logger;
 
public class LoggingDemo {
    private static Logger logger = Logger.getLogger(LoggingDemo.class.getName());
 
    public static void main(String[] args) {
//    	logger.setLevel(Level.SEVERE);
        logger.log(Level.FINE,"I am trace");
        logger.fine("I am trace at the same level");
        logger.log(Level.WARNING,"I am a warning");
        logger.log(Level.SEVERE,"I am telling about a severe problem ...");
        logger.log(Level.SEVERE, "an exception occurred", 
                   new NullPointerException("I am a pretender"));

        // a more efficient version
        if (logger.isLoggable(Level.FINEST))
            logger.log(Level.FINEST, "I am a very fine trace message"); 
    }
}
